package thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2024-09-19
 * Time: 9:39
 */
public class ThreadDome4 {
    public static void main(String[] args) {
        Thread thread = new Thread(){
          public void run(){
              while(true){
                  System.out.println("这里是由匿名内部类实现的线程");
                  try {
                      Thread.sleep(1000);
                  } catch (InterruptedException e) {
                      throw new RuntimeException(e);
                  }
              }
          }
        };
        thread.start();


        while(true){
            System.out.println("这里是main函数入口");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
